import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/userindex',
      name: 'userindex',
      component: () => import('../views/userindex.vue'),
      redirect: "/board",
      children: [
        {
          path: '/board',
          name: 'board',
          component: () => import('../views/board.vue'),
        },
        {
          path: '/detail',
          name: 'detail',
          component: () => import('../views/detail.vue'),
        },
        {
          path: '/answer',
          name: 'answer',
          component: () => import('../views/answer.vue'),
        },


        {
          path: '/wdwj',
          name: 'wdwj',
          component: () => import('../views/wdwj.vue'),
        },
        {
          path: '/wdjl',
          name: 'wdjl',
          component: () => import('../views/wdjl.vue'),
        },

      ]
    },
    {
      path: '/index',
      name: 'index',
      component: () => import('../views/index.vue'),
      redirect: "/front",
      children: [
        {
          path: '/wjxx',
          name: 'wjxx',
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import('../views/wjxx.vue'),
        },
        {
          path: '/front',
          name: 'front',
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import('../views/front.vue'),
        },

        {
          path: '/tmxx',
          name: 'tmxx',
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import('../views/tmxx.vue'),
        },
        {
          path: '/ffjl',
          name: 'ffjl',
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import('../views/ffjl.vue'),
        },
        {
          path: '/dtdetail',
          name: 'dtdetail',
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import('../views/dtdetail.vue'),
        },



      ]
    },
    {
      path: '/register',
      name: 'register',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/register.vue'),
    },
  ],
})

export default router
